<?php

function selectorstr_gen($n){
	for($i = 0; $i < $n; $i++){
		$ss[$i] = mt_rand(0, 1);
	}
	return $ss;
}

function check_id_string($mo, $id, $ss){

	for($i = 0; $i < sizeof($mo["id_hash"]); $i++){
		if(md5($id[$i]) != $mo["id_hash"][$i][$ss[$i]]){
			echo "ERROR: ID string " . $i . " does not match its commitment.\n";
			return false;
		}
	}
	return true;
}

?>